package cn.qin.xhangapi.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * 系统用户权限菜单表
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "sys_menu")
public class SysMenu {
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "parent_id")
    private Long parentId;

    @TableField(value = "`name`")
    private String name;

    @TableField(value = "description")
    private String description;

    @TableField(value = "perms")
    private String perms;

    @TableField(value = "router")
    private String router;

    @TableField(value = "component")
    private String component;

    @TableField(value = "`type`")
    private Integer type;

    @TableField(value = "sort_id")
    private Integer sortId;

    @TableField(value = "is_public")
    private Integer isPublic;

    @TableField(value = "`status`")
    private Integer status;

    @TableLogic
    @TableField(value = "deleted")
    private Integer deleted;

    /**
     * 子权限菜单列表
     */
    @TableField(exist = false)
    private List<SysMenu> children = new ArrayList<>();
}